﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Cryomancer.StarChart">
    
    <local:ArcMinToDegreesConverter x:Key="minToDegConverter" />
	<local:SingleDecimalConverter   x:Key="decimalConverter"  />
	<local:IntegerConveter          x:Key="integerConverter"  />
	
	<SolidColorBrush x:Key="HorizontalSliderTrackNormalBackground" Color="#FFE7EAEA"/>
	<LinearGradientBrush x:Key="HorizontalSliderTrackNormalBorder" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#FFAEB1AF" Offset="0.1"/>
		<GradientStop Color="White" Offset=".9"/>
	</LinearGradientBrush>
	<Style x:Key="SliderRepeatButtonStyle" TargetType="{x:Type RepeatButton}">
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="IsTabStop" Value="false"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type RepeatButton}">
					<Rectangle Fill="Transparent"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<Style x:Key="FOVValueSliderStyle" TargetType="{x:Type Slider}">
		<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Foreground" Value="#FFC4C4C4"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Slider}">
					<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
						<Grid>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
								<RowDefinition Height="Auto"/>
							</Grid.RowDefinitions>
							<Border x:Name="TrackBackground" Margin="5,0" VerticalAlignment="center" Height="4.0" Grid.Row="1" Background="{StaticResource HorizontalSliderTrackNormalBackground}" BorderBrush="{StaticResource HorizontalSliderTrackNormalBorder}" BorderThickness="1" CornerRadius="1">
								<Canvas Margin="-6,-1">
									<Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Stroke="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" StrokeThickness="1.0" Height="4.0" Visibility="Hidden"/>
								</Canvas>
							</Border>
							<Track x:Name="PART_Track" Grid.Row="1">
								<Track.DecreaseRepeatButton>
									<RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="{x:Static Slider.DecreaseLarge}"/>
								</Track.DecreaseRepeatButton>
								<Track.IncreaseRepeatButton>
									<RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="{x:Static Slider.IncreaseLarge}"/>
								</Track.IncreaseRepeatButton>
								<Track.Thumb>
									<Thumb Width="Auto" Height="Auto" Tag="{TemplateBinding Value}">
										<Thumb.Style>
											<Style TargetType="{x:Type Thumb}">
												<Setter Property="Focusable" Value="false"/>
												<Setter Property="OverridesDefaultStyle" Value="true"/>
												<Setter Property="Foreground" Value="Gray"/>
												<Setter Property="Template">
													<Setter.Value>
														<ControlTemplate TargetType="{x:Type Thumb}">
															<Border SnapsToDevicePixels="true" Background="White" BorderBrush="Black" BorderThickness="1"  RenderTransformOrigin="0.5,0.5" CornerRadius="10">
																<Border.RenderTransform>
																	<TransformGroup>
																		<ScaleTransform/>
																		<SkewTransform/>
																		<RotateTransform/>
																		<TranslateTransform/>
																	</TransformGroup>
																</Border.RenderTransform>
																<Label Width="50" HorizontalContentAlignment="Center" Content="{Binding Path=Tag, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource minToDegConverter}}" />
															</Border>
														</ControlTemplate>
													</Setter.Value>
												</Setter>
											</Style>
										</Thumb.Style>
									</Thumb>
								</Track.Thumb>
							</Track>
						</Grid>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<Style x:Key="DecimalValueSliderStyle" TargetType="{x:Type Slider}">
		<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Foreground" Value="#FFC4C4C4"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Slider}">
					<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
						<Grid>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
								<RowDefinition Height="Auto"/>
							</Grid.RowDefinitions>
							<Border x:Name="TrackBackground" Margin="5,0" VerticalAlignment="center" Height="4.0" Grid.Row="1" Background="{StaticResource HorizontalSliderTrackNormalBackground}" BorderBrush="{StaticResource HorizontalSliderTrackNormalBorder}" BorderThickness="1" CornerRadius="1">
								<Canvas Margin="-6,-1">
									<Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Stroke="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" StrokeThickness="1.0" Height="4.0" Visibility="Hidden"/>
								</Canvas>
							</Border>
							<Track x:Name="PART_Track" Grid.Row="1">
								<Track.DecreaseRepeatButton>
									<RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="{x:Static Slider.DecreaseLarge}"/>
								</Track.DecreaseRepeatButton>
								<Track.IncreaseRepeatButton>
									<RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="{x:Static Slider.IncreaseLarge}"/>
								</Track.IncreaseRepeatButton>
								<Track.Thumb>
									<Thumb  Width="Auto" Height="Auto" Tag="{TemplateBinding Value}">
										<Thumb.Style>
											<Style TargetType="{x:Type Thumb}">
												<Setter Property="Focusable" Value="false"/>
												<Setter Property="OverridesDefaultStyle" Value="true"/>
												<Setter Property="Foreground" Value="Gray"/>
												<Setter Property="Template">
													<Setter.Value>
														<ControlTemplate TargetType="{x:Type Thumb}">
															<Border SnapsToDevicePixels="true" Background="White" BorderBrush="Black" BorderThickness="1"  RenderTransformOrigin="0.5,0.5" CornerRadius="10">
																<Border.RenderTransform>
																	<TransformGroup>
																		<ScaleTransform/>
																		<SkewTransform/>
																		<RotateTransform/>
																		<TranslateTransform/>
																	</TransformGroup>
																</Border.RenderTransform>
																<Label Width="40" HorizontalContentAlignment="Center" Content="{Binding Path=Tag, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource decimalConverter}}" />
															</Border>
														</ControlTemplate>
													</Setter.Value>
												</Setter>
											</Style>
										</Thumb.Style>
									</Thumb>
								</Track.Thumb>
							</Track>
						</Grid>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<Style x:Key="IntegerValueSliderStyle" TargetType="{x:Type Slider}">
		<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Foreground" Value="#FFC4C4C4"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Slider}">
					<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
						<Grid>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
								<RowDefinition Height="Auto"/>
							</Grid.RowDefinitions>
							<Border x:Name="TrackBackground" Margin="5,0" VerticalAlignment="center" Height="4.0" Grid.Row="1" Background="{StaticResource HorizontalSliderTrackNormalBackground}" BorderBrush="{StaticResource HorizontalSliderTrackNormalBorder}" BorderThickness="1" CornerRadius="1">
								<Canvas Margin="-6,-1">
									<Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Stroke="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" StrokeThickness="1.0" Height="4.0" Visibility="Hidden"/>
								</Canvas>
							</Border>
							<Track x:Name="PART_Track" Grid.Row="1">
								<Track.DecreaseRepeatButton>
									<RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="{x:Static Slider.DecreaseLarge}"/>
								</Track.DecreaseRepeatButton>
								<Track.IncreaseRepeatButton>
									<RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="{x:Static Slider.IncreaseLarge}"/>
								</Track.IncreaseRepeatButton>
								<Track.Thumb>
									<Thumb  Width="Auto" Height="Auto" Tag="{TemplateBinding Value}">
										<Thumb.Style>
											<Style TargetType="{x:Type Thumb}">
												<Setter Property="Focusable" Value="false"/>
												<Setter Property="OverridesDefaultStyle" Value="true"/>
												<Setter Property="Foreground" Value="Gray"/>
												<Setter Property="Template">
													<Setter.Value>
														<ControlTemplate TargetType="{x:Type Thumb}">
															<Border SnapsToDevicePixels="true" Background="White" BorderBrush="Black" BorderThickness="1"  RenderTransformOrigin="0.5,0.5" CornerRadius="10">
																<Border.RenderTransform>
																	<TransformGroup>
																		<ScaleTransform/>
																		<SkewTransform/>
																		<RotateTransform/>
																		<TranslateTransform/>
																	</TransformGroup>
																</Border.RenderTransform>
																<Label Width="40" HorizontalContentAlignment="Center" Content="{Binding Path=Tag, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource integerConverter}}" />
															</Border>
														</ControlTemplate>
													</Setter.Value>
												</Setter>
											</Style>
										</Thumb.Style>
									</Thumb>
								</Track.Thumb>
							</Track>
						</Grid>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<!-- Resource dictionary entries should be defined here. -->
</ResourceDictionary>